package com.teacher.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.teacher.common.CommonResult;
import com.teacher.pojo.dto.flow.ApproveFlowDto;
import com.teacher.pojo.dto.flow.MyApproveGetDto;
import com.teacher.pojo.entity.Flow;
import com.baomidou.mybatisplus.extension.service.IService;
import com.teacher.pojo.vo.flow.FlowApproveDetailsVo;

import java.util.List;

/**
 * <p>
 * 流程总表 服务类
 * </p>
 *
 * @author zfm
 * @since 2021-08-03
 */
public interface IFlowService extends IService<Flow> {

    /**
     * 发起流程
     *
     * @param studentKey
     * @param monitorKey
     * @param name
     * @return
     */
    Long createFlow(String studentKey, String monitorKey, String name);

    /**
     * 重新发起流程
     *
     * @param flowId
     * @return
     */
    CommonResult<String> reStart(Long flowId);

    /**
     * 删除流程
     *
     * @param flowId
     * @return
     */
    CommonResult<String> del(Long flowId);

    /**
     * 审批流程
     *
     * @param dto
     * @return
     */
    CommonResult<String> approve(ApproveFlowDto dto);

    /**
     * 获取审批流详情
     *
     * @param flowId
     * @return
     */
    List<FlowApproveDetailsVo> getApproveDetails(Long flowId);

    /**
     * 查询已办
     *
     * @param dto
     * @return
     */
    CommonResult<IPage<Flow>> getHasApprove(MyApproveGetDto dto);
}
